﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<BGCMS.Models.ArticleReviewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Yfirfara grein
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="leftside">
        <% Html.RenderPartial("AdminLinks"); %>
    </div>
    <div id="content">
        <h2>
            <%: Model.Article.Title %></h2>
        <div id="articlebody">
            <%= System.Web.HttpUtility.HtmlDecode(Model.Article.TextBody) %>
        </div>
        <div id="editarticle">
            <a href="/Article/EditArticle/<%: Model.Article.ID %>">Breyta Grein</a>
        </div>
        <table class="tafla">
            <thead>
                <th>
                    Efnisflokkar
                </th>
                <th>
                </th>
            </thead>
            <tbody>
                <% foreach (var k in Model.Keywords)
                   { %>
                <tr>
                    <td>
                        <%: k.Title %>
                    </td>
                    <td>
                        <%: Html.ActionLink("Eyða", "DeleteKeyword", new { articleID = Model.Article.ID, keywordID = k.ID } ) %>
                    </td>
                </tr>
                <% } %>
            </tbody>
        </table>
        <% using (Html.BeginForm())
           {%>
        <div class="editor-field">
            <label for="newKeyword">
                Bæta við efnisflokk</label>
        </div>
        <div class="editor-field">
            <select id="newKeyword" name="newKeyword">
                <% foreach (var n in Model.AllKeywords)
                   { %>
                <option value="<%: n.ID %>">
                    <%: n.Title %></option>
                <% } %>
            </select>
        </div>
        <input type="button" value="Bæta við" onclick="addKeyword(<%: Model.Article.ID %>)" />
        <% } %>
    </div>
    <div id="approvedeny">
        <a href="#" onclick="approveOrDeny(<%: Model.Article.ID %>, 1)">Birta</a> | <a href="#"
            onclick="approveOrDeny(<%: Model.Article.ID %>, 0)">Hafna</a>
    </div>
</asp:Content>